package us.pinguo.loader.core.imageaware;

import android.graphics.Bitmap;
import android.graphics.drawable.BitmapDrawable;
import android.graphics.drawable.Drawable;
import android.view.View;
import android.widget.ImageSwitcher;

import com.nostra13.universalimageloader.core.imageaware.ViewAware;
/**
 * time: 15/6/11
 * description:对imageSwiter的包装
 *
 * @author fandong
 */
public class ImageSwitcherAware extends ViewAware {
    public ImageSwitcherAware(View view) {
        super(view);
    }

    public ImageSwitcherAware(View view, boolean checkActualViewSize) {
        super(view, checkActualViewSize);
    }

    protected void setImageDrawableInto(Drawable drawable, View view) {
        ((ImageSwitcher)view).setImageDrawable(drawable);
    }

    protected void setImageBitmapInto(Bitmap bitmap, View view) {
        ((ImageSwitcher)view).setImageDrawable(new BitmapDrawable(view.getResources(), bitmap));
    }
}
